package com.yun.zhong.fu.sharecenter.spring_origiond_code_study;

import com.yun.zhong.fu.sharecenter.entity.Share;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author RenPu
 * @Date 2022/10/24 15:41
 * @Version 1.0
 * @Description: 查询Spring源码入口
 **/
public class TestMain {

    public static void main(String[] args) {

        ApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Share share = (Share)classPathXmlApplicationContext.getBean("share");  //返回share的bean对象
        Share object = (Share)classPathXmlApplicationContext.getBean("&share"); //返回的是ShareFactoryBean的对象地址

       //实例bean的方式：
       // BeanPostProcessor（扩展点）：后置处理器、
        // FactoryBean（扩展点）：调用getObject、
        // ObjectFactory：调用getObject（spring 默认得）
        //工厂方法


    }


}
